package com.guigu.gulicommon.config;

import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Configuration;

/**
 * Nacos负载均衡配置
 *
 * @author 陈俊杰
 * @version 1.0
 * @since 2024/9/25 19:18
 */
@Log4j2
@Configuration
public class LoadBalancedRuleConfig {
//    @Bean
//    @LoadBalanced //负载均衡注解
//    public RestTemplate restTemplate() {
//        return new RestTemplate();
//    }
//
//    @Bean
//    ReactorLoadBalancer<ServiceInstance> randomLoadBalancer(Environment environment,
//                                                            LoadBalancerClientFactory loadBalancerClientFactory) {
//        String name = environment.getProperty(LoadBalancerClientFactory.PROPERTY_NAME);
//
//        return new RandomLoadBalancer(loadBalancerClientFactory.getLazyProvider(name, ServiceInstanceListSupplier.class), name);
//    }
}
